package uk.ac.lkl.common.allocator.ui;



import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;

//import java.awt.event.*;

import javax.swing.*;
//import javax.swing.event.*;

import uk.ac.lkl.common.allocator.ScheduleObject;



/**
 * @author Darren Pearce
 *
 * <p><b>Question:</b> What is this call and why do we need it? looks like it is never used.</p>
 * @param <O>
 */
public class ScheduleBlockView<O> extends JPanel {
	private static final long serialVersionUID = 1L;

    private static Cursor resizeCursor = new Cursor(Cursor.W_RESIZE_CURSOR);

    private static Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);

   // private AllocatorView scheduleView;

    private ScheduleObject<O> block;

    private Component leftPanel;

    private Component rightPanel;

    private Component centerPanel;


    public ScheduleBlockView(AllocatorView schedulePanel,
            ScheduleObject<O> block,
            Component centerPanel) {
        super(new BorderLayout());
        this.block = block;

        leftPanel = new JPanel();
        leftPanel.setPreferredSize(new Dimension(10, 0));
        leftPanel.setBackground(Color.yellow);

        rightPanel = new JPanel();
        rightPanel.setPreferredSize(new Dimension(10, 0));
        rightPanel.setBackground(Color.yellow);

        add(leftPanel, BorderLayout.WEST);
        add(rightPanel, BorderLayout.EAST);

        leftPanel.setCursor(resizeCursor);
        rightPanel.setCursor(resizeCursor);

        centerPanel.setCursor(moveCursor);
        this.centerPanel = centerPanel;
        
        add(centerPanel, BorderLayout.CENTER);
        
        setBorder(BorderFactory.createEtchedBorder());

    }


    public Component getLeftPanel() {
        return leftPanel;
    }


    public Component getRightPanel() {
        return rightPanel;
    }


    public Component getCenterPanel() {
        return centerPanel;
    }


    public ScheduleObject<O> getBlock() {
        return block;
    }

}
